CREATE TABLE [dbo].[TTPARA_PRUS]
(
[CO_USUA] [dbo].[TD_VC_008] NOT NULL,
[CO_SIST] [dbo].[TD_VC_008] NOT NULL,
[CO_MODU] [dbo].[TD_VC_008] NOT NULL,
[CO_MENU] [dbo].[TD_VC_020] NOT NULL,
[CO_ATRI] [dbo].[TD_VC_020] NOT NULL,
[NU_CORR_ATRI] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTPARA_PR__NU_CO__7D98A078] DEFAULT ((0)),
[ST_RANG] [dbo].[TD_VC_001_SINO] NULL,
[ST_SELE] [dbo].[TD_VC_001_SINO] NULL,
[ST_SIMI] [dbo].[TD_VC_001_SINO] NULL,
[ST_EXCL] [dbo].[TD_VC_001_SINO] NULL,
[NU_PRED] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTPARA_PR__NU_PR__025D5595] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTPARA_PR__CO_US__035179CE] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTPARA_PR__FE_US__04459E07] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTPARA_PR__CO_US__0539C240] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTPARA_PR__FE_US__062DE679] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTPARA_PRUS] WITH NOCHECK ADD CONSTRAINT [CK__TTPARA_PR__ST_EX__0169315C] CHECK NOT FOR REPLICATION (([ST_EXCL]='N' OR [ST_EXCL]='S'))
GO
ALTER TABLE [dbo].[TTPARA_PRUS] WITH NOCHECK ADD CONSTRAINT [CK__TTPARA_PR__ST_RA__7E8CC4B1] CHECK NOT FOR REPLICATION (([ST_RANG]='N' OR [ST_RANG]='S'))
GO
ALTER TABLE [dbo].[TTPARA_PRUS] WITH NOCHECK ADD CONSTRAINT [CK__TTPARA_PR__ST_SE__7F80E8EA] CHECK NOT FOR REPLICATION (([ST_SELE]='N' OR [ST_SELE]='S'))
GO
ALTER TABLE [dbo].[TTPARA_PRUS] WITH NOCHECK ADD CONSTRAINT [CK__TTPARA_PR__ST_SI__00750D23] CHECK NOT FOR REPLICATION (([ST_SIMI]='N' OR [ST_SIMI]='S'))
GO
ALTER TABLE [dbo].[TTPARA_PRUS] ADD CONSTRAINT [PK__TTPARA_P__56B9C66D72B0FDB1] PRIMARY KEY CLUSTERED  ([CO_USUA], [CO_SIST], [CO_MODU], [CO_MENU], [CO_ATRI], [NU_CORR_ATRI]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTPARA_PRUS] ADD CONSTRAINT [FK__TTPARA_PRUS__55DFB4D9] FOREIGN KEY ([CO_SIST], [CO_MODU], [CO_MENU], [CO_ATRI], [NU_CORR_ATRI]) REFERENCES [dbo].[TTATRI_SIST] ([CO_SIST], [CO_MODU], [CO_MENU], [CO_ATRI], [NU_CORR_ATRI])
GO
ALTER TABLE [dbo].[TTPARA_PRUS] ADD CONSTRAINT [FK__TTPARA_PR__CO_US__56D3D912] FOREIGN KEY ([CO_USUA]) REFERENCES [dbo].[TMUSUA] ([CO_USUA])
GO
GRANT SELECT ON  [dbo].[TTPARA_PRUS] TO [public]
GRANT INSERT ON  [dbo].[TTPARA_PRUS] TO [public]
GRANT DELETE ON  [dbo].[TTPARA_PRUS] TO [public]
GRANT UPDATE ON  [dbo].[TTPARA_PRUS] TO [public]
GO
